﻿<?
	$hosts_string="";
	foreach($datacenter->result() as $myrow)
	{
		$hosts_string.=$myrow->lip."\t".$myrow->servername."\n";
	}
	
	foreach($servercenter->result() as $myrow1)
	{
		$hosts_string.=$myrow1->serverlip."\t".$myrow1->servername."\n";
	}	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$charset?>" />
<title><?=$title?></title>
<meta  name="keywords" content="<?=$keywords?> " />
<meta  name="description" content="<?=$description?>"/>	

<!-- CSS -->
<link href="/style/css/transdmin.css" rel="stylesheet" type="text/css" media="screen" />
<!--[if IE 6]><link rel="stylesheet" type="text/css" media="screen" href="/style/css/ie6.css" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" type="text/css" media="screen" href="/style/css/ie7.css" /><![endif]-->

<!-- JavaScripts-->
<script type="text/javascript" src="/style/js/jquery.js"></script>
<script type="text/javascript" src="/style/js/jNice.js"></script>
<script language="javascript" src="/js/prototype.js"></script>
<script type="text/javascript" src="/js/ZeroClipboard.js"></script>
<script language="JavaScript">
	ZeroClipboard.setMoviePath( "/js/ZeroClipboard.swf" );
	(function () {
		var ie = !!(window.attachEvent && !window.opera);
		var wk = /webkit\/(\d+)/i.test(navigator.userAgent) && (RegExp.$1 < 525);
		var fn = [];
		var run = function () { for (var i = 0; i < fn.length; i++) fn[i](); };
		var d = document;
		d.ready = function (f) {
			if (!ie && !wk && d.addEventListener)
			return d.addEventListener('DOMContentLoaded', f, false);
			if (fn.push(f) > 1) return;
			if (ie)
			(function () {
			try { d.documentElement.doScroll('left'); run(); }
			catch (err) { setTimeout(arguments.callee, 0); }
			})();
			else if (wk)
		var t = setInterval(function () {
			if (/^(loaded|complete)$/.test(d.readyState))
			clearInterval(t), run();
		}, 0);
		};
})();

document.ready(function(){
	var clip = new ZeroClipboard.Client();
	clip.setText(document.getElementById("hosts_str").value);
	clip.addEventListener( 'complete', function(client, text) {
		alert("己复制hosts内容到剪贴板!");
	} );
	clip.glue('d_clip_button');
});
</script>
</head>

<body>
<div id="systemWorking" style="z-index:100; position:absolute;display:none;left:40%;top:40%"><table width="250" height="20" border="0" cellpadding="0" cellspacing="1" bgcolor="#6EB1F4"><tr><td bgcolor="#FFFFFF" align="center" valign="middle"><img src="/images/loading.gif" align=center>　　系统正在处理中...</td></tr></table></div>
	<div id="wrapper">
    	<h1><a href="#"><span>天翌LVS管理系统</span></a></h1>     
			<?
			  	include "lvsmenu_view.php";
			?>   
	</div>
            <!-- // #container -->
<table height="500" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#EEEEEE" class="tables_main">
      <tr>
        <td height="193" align="center">
	<table width="20" border="0" cellpadding="00">
          <tr>
            <td height="4"></td>
          </tr>
        </table>
	<table height="490" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
          <tr>
            <td width="80" height="60" valign="top">
			<?
			include "lvsfunmenu_view.php";
			?>
			</td>
            <td width="1" rowspan="2" align="center" valign="top" bgcolor="#eeeeee"></td>
            <td width="735" rowspan="2" align="center" valign="top">
		<div align="left">
		<table width="98%" height="31" border="0" cellpadding="00" cellspacing="1">
                 <tr>
                   <td width="2">&nbsp;</td>
                 <td width="240" valign="bottom"><a href="/lvs/">LVS管理</a> &raquo; <a href="/lvs/hosts" class="active">生成hosts</a></td>
                 </tr>
                 <tr>
                   <td></td>
                   <td height="1" bgcolor="#EEEEEE"></td>
                 </tr>
               </table>
		<br />
	<br>
	<table width="98%" height="400" border="0" align="center" cellpadding="0" cellspacing="0">
	<form name="hostF">
	<tr>
	<td align="left">
		如你的主机名不能直接被识别，请修改管理服务器的hosts文件。<br><br>
		<a id="d_clip_button" style="cursor:hand">复制内容到剪贴板</a><br>
		<textarea id="hosts_str" name="hosts_str" rows="20" cols="75" readonly><?=$hosts_string?></textarea>
	
	</td>
	</tr>
	</form>
	</table>			
			</td>
          </tr>
          <tr>
            <td height="85" valign="top" bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
        </table>
		<table width="20" border="0" cellpadding="00">
          <tr>
            <td height="4"></td>
          </tr>
        </table>		
		</td>
      </tr>
    </table>
<br>
</body>
</html>